---
layout: ami
permalink: settings/
---
<div class="section">
    <h2 class="title">Choose an AMI password</h2>
    <div class="steps">
        <p class="complete">Create a self-signed certificate</p>
        <p class="step-two">Choose a password for the AMI</p>
        <p class="step-three">Initialize the AMI</p>
    </div>
    <div class="step-content step-two">
        <form name="form" method="POST" action="/action/set_password" onsubmit="return validate()">
            <p>Please enter the ID of this EC2 instance to confirm your identity.</p>
            <div class="infobox infobox-error" style="display:none" id="wrong_instance_id">
              Please enter the correct instance ID.
            </div>
            <p><label for="password">Instance ID:</label> <input type="text" name="instanceid" id="instanceid" /></p>
            <p>Please chose a password to initialize the AMI. This password will be used to access the web UI and as an authentication key for client drivers.</p>
            <p><label for="password">Choose a password:</label> <input type="password" name="password" id="password" /></p>
            <p><label for="password2">Repeat password:</label> <input type="password" name="password2" id="password2" /></p>
            <!--
            <p>If you want this instance to connect to an existing cluster, enter one or more host:port values here, separated by spaces. Otherwise leave this field blank.</p>
            <p><label for="join">Connect to cluster:</label> <input type="text" name="join" id="join" /></p>
            -->
            <button id="submit-password" class="btn" type="submit">Set up AMI &rarr;</button>
        </form>

        {% include ami-docs.html %}
    </div>
</div>
<script>
    function validate(){
        var f = document.forms["form"];
        if(f["password"].value != f["password2"].value){
            alert("The passwords don't match.");
            return false;
        }
    }

    if (location.search === '?wrong_instance_id') {
        var div = document.getElementById('wrong_instance_id');
        div.style.display = 'block';
    }
</script>
